"""商城首页"""
from selenium.webdriver.common.by import By

from page_objects.base_page import BasePage


class HomePage(BasePage):
    __MENU_MALL_MANAGE = (By.XPATH, "//*[text()='商场管理']")
    __MENU_PRODUCT_CATEGORY = (By.XPATH, "//*[text()='商品类目']")

    """进入商品类目"""
    def go_to_category(self):
        # 点击商城管理
        # self.driver.find_element(By.XPATH, "//*[text()='商场管理']").click()
        self.do_find(self.__MENU_MALL_MANAGE).click()
        # 点击商城类目
        # self.driver.find_element(By.XPATH, "//*[text()='商品类目']").click()
        self.do_find(self.__MENU_PRODUCT_CATEGORY).click()

        # ==》进入商城列表类目页面

        from page_objects.category_list_page import CategoryListPage
        return CategoryListPage(self.driver)
